#define _CRT_SECURE_NO_WARNINGS 1

#include <iostream>
#include <queue>
using namespace std;
int main()
{
    int n, k;
    cin >> n >> k;
    priority_queue<int> heap;
    int a;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        heap.push(a);
    }
    long long sum = 0;
    while (heap.size() && k)
    {
        int t = heap.top();
        heap.pop();
        if (t % 2 == 0)
        {
            heap.push(t / 2);
            k--;
        }
        else
        {
            sum += t;
        }
    }
    while (heap.size())
    {
        int t = heap.top();
        heap.pop();
        sum += t;
    }
    cout << sum << endl;
    return 0;
}
